<template>
  <div class="dashboard-container" >
  			    <div class="item">
		    	<h1>学生人数</h1>
		    	<h1>{{studentCount}}</h1>
		    </div>
		    <div class="item">
		    	<h1>学院总数</h1>
		    	<h1>{{academyCount}}</h1>
		    </div>
		     <div class="item">
		    	<h1>学院班级总数</h1>
		    	<h1>{{classsCount}}</h1>
		    </div>
		    <div class="item">
		    	<h1>学校总数</h1>
		    	<h1>{{schoolCount}}</h1>
		    </div>
		    <div class="item">
		    	<h1>教师总数</h1>
		    	<h1>{{teacherCount}}</h1>
		    </div>
	</div>
  </div>
</template>

<script>
  import { mapGetters } from 'vuex'

  export default {
    name: 'Dashboard',
    computed: {
      ...mapGetters([
        'name'
      ])
    },
    data(){
    	return{
    		students:{},
    		studentCount:0,
    	}
    },
    data(){
    	return{
    		academy:{},
    		academyCount:0,
    	}
    },
    	
    data(){
    	return{
    		classs:{},
    		classsCount:0,
    	}
    },

    data(){
    	return{
    		school:{},
    		schoolCount:0,
    	}
    },
    data(){
    	return{
    		teacher:{},
    		teacherCount:0,
    	}
    },


    	
    	
    	
    	// return{
    	// 	students:{},
    	// 	studentCount:0,
    	// }


    mounted() {
      this.$http.post('/api/student/get').then(res => {
        this.students = res;
        console.log(this.students.length)
        this.studentCount = this.students.length
      })

      this.$http.post('/api/academy/get').then(res => {
        this.academy = res;
        console.log(this.academy.length)
        this.academyCount = this.academy.length
      })

      this.$http.post('/api/classs/get').then(res => {
        this.classs = res;
        console.log(this.classs.length)
        this.classsCount = this.classs.length
      })


      this.$http.post('/api/school/get').then(res => {
        this.school = res;
        console.log(this.school.length)
        this.schoolCount = this.school.length
      })

      this.$http.post('/api/teacher/get').then(res => {
        this.teacher = res;
        console.log(this.teacher.length)
        this.teacherCount = this.teacher.length
      })
    }

  }
</script>

<style lang="scss" scoped>
  .dashboard {
    &-container {
      margin: 30px;
    }
    &-text {
      font-size: 30px;
      line-height: 46px;
    }
  }
  
  
  .dashboard-container{
  display: flex;
}

  .item{
    text-align: center;
    transition: all 0.3s;
    position: relative;
    border-radius: 3px;
    top: 0;
    box-shadow: 0 0 0 0 rgba(0,0,0,0.2);
    padding: 10px;
    margin: 10px;
  }
  .item:hover{

    top: -20;
    box-shadow: 1px 10px 15px 2px rgba(0,0,0,0.1);
  }
</style>